Scissor = {}

local function setScissorDirty(self)
    self._scissorDirty = true
end
function Scissor:ctor()
    self._scissorDirty = true
    self:on(NodeEvent.TransformDirty, setScissorDirty, self)
    self:on(NodeEvent.WidthChanged, setScissorDirty, self)
    self:on(NodeEvent.HeightChanged, setScissorDirty, self)
end
function Scissor:getScissorInfo()
    if self._scissorDirty then
        local x, y = self:leftTop()
        local w, h = self.wsx * self.width, self.wsy * self.height
        self._scissorInfo = {
            renderType = RenderType.Scissor,
            args = {x, y, w, h},
            cmp = self
        }
        self._scissorDirty = false
    end
    return self._scissorInfo
end